const files = require.context('.', false, /\.jsx?$/)



const modules = {};

files.keys().forEach(key => {
  if (key === "./index.jsx") return;

  const str = key.replace(/(\.\/|\.jsx?)/g, "");
  const arr = str.split(".").map(item=>{
   return item.slice(0, 1).toUpperCase() + item.slice(1);
  });


  const mKey = arr.join("");

  console.log(mKey);
  modules[mKey] = files(key).default;

});

module.exports =modules;